<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class ChangeFieldsForElBalanceCashTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('el_balance_cash', function (Blueprint $table) {
            $table->integer('bank_account_id')->default(0)->change();
            $table->string('bank_name')->nullable()->change();
            $table->string('bank_number')->nullable()->change();
            $table->string('owner_name')->nullable()->change();
        });

        Schema::table('el_balance_cash', function (Blueprint $table) {
            $table->string('cash_type')->default('customer_account'); //提现到账类型：自定义账户；微信钱包customer_wechat
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('el_balance_cash', function (Blueprint $table) {
            $table->dropColumn('cash_type');
        });
    }
}
